namespace Study304 {


  interface Ibairen {
    tezheng1: string
  }
  interface IHeiren {
    tezheng2: string
  }
  interface IHuang {
    tezheng3: string
  }

  interface IHunxue {
    tezheng1: string
    tezheng2: string
    tezheng3: string
    tezheng4: string
  }

  class Person {

    name: string
    sex: string
    age: number

    zhongzu: Ibairen | IHeiren | IHuang

    constructor(name: string, sex: string, age: number, zhongzu: Ibairen | IHeiren | IHuang) {
      this.name = name
      this.sex = sex
      this.age = age

      this.zhongzu = zhongzu
    }


  }


  class Person2<T> {

    name: string
    sex: string
    age: number

    zhongzu: T

    constructor(name: string, sex: string, age: number, zhongzu: T) {
      this.name = name
      this.sex = sex
      this.age = age

      this.zhongzu = zhongzu
    }


  }

  // Person2(name: string, sex: string, age: number, zhongzu: Ibairen): Person2<Ibairen>
  let pc21 = new Person2<Ibairen>(
    '特朗普',
    'nan',
    80,
    {
      tezheng1: '皮肤很白很滑很腻'
    }
  )

  let pc22 = new Person2<IHeiren>(
    '奥巴马',
    'nan',
    99,
    {
      tezheng2: '喜欢摘棉花，弹棉花，吃炸鸡，吃西瓜，喝可乐'
    }
  )

  let pc23 = new Person2<IHuang>(
    '丁真',
    'nan',
    23,
    {
      tezheng3: '抽锐刻五代'
    }
  )

  let pc24 = new Person2<IHunxue>(
    '谷爱凌',
    'nv',
    30,
    {
      tezheng1: '吃咸菜',
      tezheng2: '滑雪',
      tezheng3: '三姓家奴',
      tezheng4: '被中共中央、国务院表彰为北京冬奥会、冬残奥会突出贡献个人'
    }
  )

}